layui.use(['table', 'form', 'jquery', 'laydate', 'layer'], function () {
    let table = layui.table;
    let form = layui.form;
    let laydate = layui.laydate;
    let layer = layui.layer;
    let $ = layui.jquery;

    let BIZ_NAME = 'consumption-times';
    let BIZ_TABLE = 'consumption-times-table';
    let BIZ_FORM = 'consumption-times-form';
    let BIZ_QUERY = 'consumption-times-query';
    let tableConsumptionTimesObj;

    let cols = [
        [
            {title: '记录编号', field: 'id', align: 'center'},
            {title: '会员ID', field: 'memberId', align: 'center'},
            {title: '会员名称', field: 'memberName', align: 'center'},
            {title: '充次记录ID', field: 'rechargeId', align: 'center'},
            {title: '充值活动名称', field: 'activityName', align: 'center'},
            {title: '消费次数', field: 'times', align: 'center'},
            {title: '消费项目', field: 'items', align: 'center'},
            {title: '消费时间', field: 'consumptionTime', align: 'center'},
            {title: '进店渠道', field: 'fitEntryChannels', align: 'center'},
            {title: '操作人', field: 'operators', align: 'center'},
            {title: '创建时间', field: 'time', align: 'center'}
        ]
    ]
    window.renderConsumptionTimesTable = function (where) {
        tableConsumptionTimesObj = table.render({
            elem: '#' + BIZ_TABLE,
            url: '/' + BIZ_NAME + '/page',
            where: where,
            //data: [{id:1}], // 测试数据
            text: {none: '暂无相关数据'},
            response: {
                statusCode: 200,
                msgName: 'message'
            },
            page: true,
            limit: 10,
            limits: [10, 20, 50],
            cols: cols,
            skin: 'line',
            defaultToolbar: [{
                layEvent: 'refresh',
                icon: 'layui-icon-refresh',
            }, 'filter', 'print', 'exports']
        });
    }

});